
$(function () {
	
	$.get("../querypersonnelcommutertime/class/list", function(r){
//		vm.area = r.shiftrangelist;
        var list = r.shiftrangelist;
        var html='';
        html+='<option value="全部">请选择全部</option>';
        $.each(list,function(index,item){
        	
        	html+='<option value="'+item.name+'">'+item.name+'</option>';
        	
        });
        $("#liebiao").html(html);
        
    });
	
$(function () {
    $("#jqGrid").jqGrid({
        url: '../querypersonnelcommutertime/list',
        datatype: "json",
        colModel: [			
			{ label: '姓名', name: 'namePersonnel', width: 50, key: true },
			{ label: '班次', name: 'nameShiftrange', width: 80 }, 			
			{ label: '入场时间', name: 'triggertime', width: 80 }, 			
			{ label: '离岗时间', name: 'lasttime', width: 80 }			
        ],
		viewrecords: true,
           height: 'auto',
        rowNum: 10,
		rowList : [10,30,50],
        rownumbers: true, 
        rownumWidth: 25, 
        autowidth:true,
        multiselect: true,
        pager: "#jqGridPager",
        jsonReader : {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames : {
            page:"page", 
            rows:"limit", 
            order: "order"
        },
        gridComplete:function(){
        	//隐藏grid底部滚动条
        	$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); 
        }
    });
});
});
var search=document.getElementById("search");
search.onclick=function(){
	var page = $("#jqGrid").jqGrid('getGridParam','page');
	$("#jqGrid").jqGrid('setGridParam',{
		  postData:{'name': $("#liebiao1").val(),'type':$("#liebiao").val(),'time':$("#d4311").val()},
        page:page
    }).trigger("reloadGrid");
};
function t(){  
	var type=$("#liebiao").val();
    var field=$("#liebiao1").val(); //可以是一个可变的值  
    var time=$("#d4311").val(); //可以是一个可变的值  
    
    document.getElementById("n").href="../querypersonnelcommutertime/excel?type="+type+"&field="+field+"&time="+time;
}